home *** CD-ROM | disk | FTP | other *** search
/ Developer Helper 1: Phil & Dave's Excellent CD / Excellent CD HFS.raw / Moof / Goodies / MPW Goodies / MPW Goodies⁄DTS / SetProjector < prev    next >
Text File  |  2022-08-05  |  1KB  |  56 lines

  1. #
  2. # SetProjector        Andrew Shebanow                    6/28/88
  3. #
  4. # Modification History:
  5. #
  6. #    2/6/89(AGS)        Added code to execute ProjInit script
  7. #    1/24/89(AGS)    Changed 'cd' command to 'Directory',
  8. #                    added check for no mounted projects.
  9. #    6/30/88(DJB)    Changed from using replace on files
  10. #                    to using Evaluate
  11. #    7/8/88(AGS)        Always get current list of mounted projects
  12. #    7/16/88(AGS)    Modified to use new MountProject commands to get
  13. #                    mounted project list. Much faster, and cleaner.
  14. #
  15. # Script to set a project as the current project.
  16. #
  17. # Note that you must use Execute to run this script
  18. # if you want BuildMenu to know about your new build
  19. # target.
  20. #
  21.  
  22. # save exit status, since we are executing at global scope
  23. Set OldExit {Exit}
  24. Set Exit 0
  25.  
  26. # Get list of mounted projects
  27. Set ProjectNameList "`MountProject -pp -s -r | Sort -l`"
  28.  
  29. # Set up project specific items
  30. Set ProjName NIL
  31.  
  32. # Make sure we have at least one project mounted
  33. If "{ProjectNameList}" == ""
  34.     Alert "Cannot set project: no projects are mounted."
  35.     # restore previous state of {Exit}
  36.     Set Exit {OldExit}
  37.     Exit 0
  38. End
  39.  
  40. Set ProjName `GetListItem -r 16 -s -d {ProjectNameList} -m "Choose a project"` > Dev:Null ≥ Dev:Null
  41. Export ProjName
  42. if "{ProjName}" != NIL
  43.  
  44.     # set the current project
  45.     Execute SetProject
  46.     
  47.     # Extract the Build Name and set it
  48.     ( Evaluate "{ProjName}" =~ /([a-zA-Z0-9_. ]+∂∫)*([¬∂∫]+)®1∂∫/ ) ∑ Dev:Null
  49.     Set Program "{®1}"
  50.     Export Program
  51.  
  52. End
  53.  
  54. # restore previous state of {Exit}
  55. Set Exit {OldExit}
  56.